$(document).ready(function () {
   $("#languageSelect").next().next().children().children("a").click(function () {
       $("#languageSelect").text($(this).text());
       $("#languageSelect").attr("about",$(this).attr("about"));

   });

});
//翻译文本
function translateContext() {
    var textarea=$("#upTextarea").val();
    var fromTo=$("#languageSelect").attr("about");
    $.ajax({
        type:"post",
        url:"/APIServlet",
        data:"action=translateContext&textarea="+textarea+"&fromTo="+fromTo,
        dataType:"json",
        success:function (data) {
            $("#downTextarea").val(data.trans_result[0].dst);
        },
    });

}